package com.example.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

@Data
@Schema(description = "用户信息")
public class User {
    private Long id;

    @Schema(description = "用户名")
    private String username;

    @JsonIgnore
    @Schema(description = "密码")
    private String password;

    @Schema(description = "昵称")
    private String nickname;

    @Schema(description = "手机号")
    private String phoneNum;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "性别")
    private Byte gender;

    @JsonIgnore
    @Schema(description = "盐值")
    private String salt;

    @Schema(description = "头像地址")
    @JsonInclude(JsonInclude.Include.ALWAYS) //表示不论任何情况下，对应属性都参与序列化,也就是强制参与序列化
    private String avatarUrl;

    @Schema(description = "发帖数")
    private Integer articleCount;

    @Schema(description = "是否是管理员")
    private Byte isAdmin;

    @Schema(description = "个人简介")
    private String remark;

    private Byte state;

    @JsonIgnore
    @Schema(description = "删除状态")
    private Byte deleteState;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间")
    private Date updateTime;
}